import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import req from "./axios";
import hljs from 'highlight.js';
import 'highlight.js/styles/monokai-sublime.css'

Vue.prototype.req = req;
Vue.config.productionTip = false;



//自定义一个代码高亮指令
Vue.directive('highlight',function (el) {
    let highlight = el.querySelectorAll('pre code');
    highlight.forEach((block)=>{
        hljs.highlightBlock(block)
    })
})


Vue.directive('title', {//单个修改标题
  inserted: function (el,binding) {
    document.title = el.dataset.title
  }
});

new Vue({
    router,

    store,
    render: h => h(App)
}).$mount('#app')
